﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace ThreeByte.ActiveDeck.Data.UserResponse.Report {

    [IndividualUserData(ShortTypeName = "MultipleChoice")]
    public class MultipleChoiceIndividualData : IndividualUserData {
        
        public MultipleChoiceIndividualData() {
            TextAnswer = "";
        }

        public int Answer {
            get;
            set;
        }

        public string TextAnswer {
            get;
            set;
        }

        public MultipleChoiceIndividualData(XElement node) : this() {
            Section = int.Parse(node.Attribute("Section").Value);
            Page = int.Parse(node.Attribute("Page").Value);
            
        
            int theAnswer = 0;
            if(int.TryParse(node.Attribute("Answer").Value, out theAnswer)){
                Answer = theAnswer;
            }

            TextAnswer = "";
        }
        
        public override bool UpdateUserData(IndividualUserData newUserData) {
            throw new NotImplementedException();
        }
    }
}
